<template>
  <div id="app">
    <div id="nav">
      <router-link class="nav-item" to="/">折线图</router-link>
      <router-link class="nav-item" to="/pie">3D饼状图</router-link>
      <router-link class="nav-item" to="/PartialIntroduction">组织架构图</router-link>
    </div>
    <div class="mainBox">
      <router-view />
    </div>
  </div>
</template>
<script>
export default {
  data(){
    return{
      spinShow:true
    }
  },
  mounted() {
    this.initData()
  },
  methods:{
    initData(){
      this.spinShow = true
      this.axios.get('https://api.inews.qq.com/newsqa/v1/query/inner/publish/modules/list?modules=chinaDayList,chinaDayAddList,nowConfirmStatis,provinceCompare').then( res =>{
        const data = res.data.data
        this.$store.commit('set_provinceCompare',data.provinceCompare)
        this.spinShow = false
      }).catch(err=>{
        console.log(err);
      })
    }
  }
}
</script>
<style lang="less">
*{
  padding: 0;
  margin: 0;
}
#app{
  #nav{
    padding: 20px;
    background-color: #31333d;
    color: white;
    .nav-item{
      color: white;
      margin-right: 20px;
    }
  }
  .mainBox{
    width: 1000px;
    height: 700px;
    margin: 0 auto;
    position: relative;
    .loadingDiv{
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%,-50%);
    }
  }
}
</style>
